From: | David McMinn |
Date: | 30 Aug 99 at 18:27:01 |
Subject: | Re: string -> float |
> I'm trying to convert a string of the form 1e23 into a float so that I can
> perform maths on it. Only problem is - Val() doesn't support the "e".
> Anybody know of a way in which I can do this?
If you assume that the string is only going to contain <mantissa>e<exponent>,
then you could try this:
a$="1e23"
man.w = val(a$)
eloc.w = Instr(a$,"e")
if eloc>0
else
end if
floata.f = man * 10 ^ exp
I'm not sure if the code for finding the location of the start of the exponent
is correct, but its something like that
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie